﻿using Model.DomainModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utility.Enum;

namespace Infrastructure.IRepository
{
    /// <summary>
    /// 流程消息仓储接口
    /// </summary>
    public interface IFlowMessageRepository : IRepository<FlowMessage>
    {
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="flowMessages">流程信息</param>
        void BulkInsert(List<FlowMessage> flowMessages);

        /// <summary>
        /// 获取流程信息数据
        /// </summary>
        /// <param name="flowApplyId">流程申请id</param>
        /// <param name="nodeId">节点id</param>
        /// <returns></returns>
        List<FlowMessage> GetFlowMessageData(string flowApplyId, string nodeId);

        /// <summary>
        /// 获取流程信息数据
        /// </summary>
        /// <param name="messageRecipient">消息接收人id</param>
        /// <returns></returns>
        List<FlowMessage> GetFlowMessageByUserId(string messageRecipient);

        /// <summary>
        /// 更新流程信息
        /// </summary>
        /// <param name="flowMessage">消息数据</param>
        void UpdateFlowMessage(FlowMessage flowMessage);

        /// <summary>
        /// 获取未处理的流程消息
        /// </summary>
        /// <param name="flowMessage">消息数据</param>
        List<FlowMessage> GetUnHandledFlowMessage(FlowMessage flowMessage);

        /// <summary>
        /// 根据条件查询数据
        /// </summary>
        /// <param name="flowApplyId">申请id</param>
        /// <param name="recipientKeys">接收者key集合</param>
        /// <param name="messageSender">发送者key</param>
        /// <param name="messageType">消息类型</param>
        /// <returns></returns>
        List<FlowMessage> GetCarbonCopyFlowMessage(string flowApplyId, List<string> recipientKeys, string messageSender, MessageTypeEnum messageType);
    }
}
